/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.penguin.modules.field.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.penguin.modules.field.entity.FieldCustomerPos;
import com.thinkgem.penguin.modules.field.dao.FieldCustomerPosDao;

/**
 * 商家POS机管理维护Service
 * @author 余小凡
 * @version 2015-05-21
 */
@Service
@Transactional(readOnly = true)
public class FieldCustomerPosService extends CrudService<FieldCustomerPosDao, FieldCustomerPos> {

	public FieldCustomerPos get(String id) {
		return super.get(id);
	}
	
	public List<FieldCustomerPos> findList(FieldCustomerPos fieldCustomerPos) {
		return super.findList(fieldCustomerPos);
	}
	 
	public Page<FieldCustomerPos> findPage(Page<FieldCustomerPos> page, FieldCustomerPos fieldCustomerPos) {
		return super.findPage(page, fieldCustomerPos);
	}
	
	@Transactional(readOnly = false)
	public void save(FieldCustomerPos fieldCustomerPos) {
		if(fieldCustomerPos.getId()==null||"".equals(fieldCustomerPos.getId())){//新增 插入对应的维护员工
			super.save(fieldCustomerPos);
			dao.insertPosUser(fieldCustomerPos);
		}else{
			dao.updatePosUser(fieldCustomerPos);	
			super.save(fieldCustomerPos); 
		}
		
	}
	
	@Transactional(readOnly = false)
	public void delete(FieldCustomerPos fieldCustomerPos) {
		super.delete(fieldCustomerPos);
	}
	
}